{% extends "::base.html.twig" %}


{% block sf_content %}
    
<div class="row">
    
    <div class="span10 offset1">
        
        {% if form.vars.errors|length %}
        <p style="margin-top:20px;" class="alert zk-error">{{ form_errors(form) }}</p>
        {% endif %}
    
        {% set p = role.id ? path('zk_admin_role_edit',{'id':role.id}) : path('zk_admin_role_new') %}
        
        <form class="well well-large row-shadow"
              action="{{ p }}"
              method="post" {{ form_enctype(form) }}>
            
            <legend>{{ role.id ? role.name : 'New ROLE' }}</legend>
            
            <div class="row">
                <div class="span5">{{ form_errors(form.role) }}{{ form_row(form.role) }}</div>
            </div>
            
            <div class="row">
                <div class="span5">{{ form_row(form.name) }}</div>
            </div>
            
            <div class="row">
                <div class="span5">{{ form_widget(form.descr) }}</div>
            </div>
            
            <div class="row">
                <div class="span3">{{ form_row(form.save) }}</div>
            </div>
            
            <div style="display:none;">{{ form_rest(form) }}</div>
            
        </form>
    
    </div>
    
    <div class="span3 offset1">
        <a href="{{ path('zk_admin_role_list') }}" class="btn btn-success">{{ 'Back to list'|trans }}</a>
    </div>
    
</div>

{% endblock sf_content %}
